<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<head>
<title>话题线|北京时间</title>
<script src='${baseurl}dwr/interface/ourdiaryDwr.js'></script>
<script src='${baseurl}dwr/engine.js'></script>
<script src='${baseurl}dwr/util.js'></script>

<script type="text/javascript">
function followTrend(trend){
	document.getElementsByName("trend")[0].value=trend;
	document.getElementById("followTrendForm").submit();
}

function invent(id){
	if(isEmpty(document.getElementById(id).value)){
		return;
	}
	document.getElementsByName("statuses")[0].value=document.getElementById(id).value;
	document.getElementById("inventForm").submit();
}
</script>
</head>
<body>
<form action="./ourdiary.html?method.invent=" method="post"  id="inventForm">
<input type="hidden" name="statuses" />
</form>
<form action="./ourdiary.html?method.followTrend=" method="post" id="followTrendForm">
<input type="hidden" name="trend" />
</form>
<a href="./refresh.html?redirect=trendsAndFriends">刷新</a>
<div id="container_weibo">
	<ul id="friends_trend" class="friends_trend" >
		<li class="active"><a href="#friend_trend">朋友关注的话题</a></li>
		<li><a href="#box_trend">话题集</a></li>
		<span><a href="./line.html">返回时间线首页</a></span>
	</ul>
	<div id="friend_trend" class="content_friendstrend clearfix"  >
			<c:forEach var="item" items="${allFriendTrends}" varStatus="s"> 
			<ul class="box col_friend_list">
				<li>
					<img src="${item.key.avatarLarge}" width="110px"/><br/>${item.key.screenName}
					<ul>
						<c:forEach var="item2" items="${item.value}"> 
						<li>	${item2.hotword}&nbsp; 
							<c:choose>
								<c:when test="${fn:contains(alltrends, item2.hotword)}">已关注</c:when>
								<c:otherwise><span onclick="followTrend('${item2.hotword}')">+关注</span></c:otherwise>
							</c:choose>
						</li>
						</c:forEach>
					</ul>
					<textarea rows="" cols="" id="statuses${s.index}">@${user.screenName }通过话题线邀请您@${item.key.screenName}参与##</textarea>
					<input type="button" value="邀请" onclick="invent(‘statuses${s.index}')" />
				</li>
			</ul>
		</c:forEach> 
	</div>
	<div id="box_trend" class="content_friendstrend">
		<div class="trends_array">
			<c:forEach var="item" items="${trendPaticipator}"> 
				<div class="trends">	
					<span>${item.key} &nbsp;&nbsp;
					<c:choose>
						<c:when test="${fn:contains(alltrends, item.key)}">已关注</c:when>
						<c:otherwise><a href="javascript:followTrend('${item.key}')">加关注</a></c:otherwise>
					</c:choose>
					</span><br/><br/>
					<c:forEach var="item2" items="${item.value}"> 
						<li>	<img src="${item2.avatarLarge}" width="110"/><br/>${item2.screenName}</li>
					</c:forEach>
					<div class="clear"></div>
				</div>
			</c:forEach> 
		</div>
	</div>
	<div class="clear"></div>
</div>
</body>
